Open
Conversation
kouz95
requested changes
Apr 24, 2020
Member
kouz95
left a comment
There was a problem hiding this comment.
첫 객체 분리네요 :) 고생 많으셨습니다.
피드백 남겼으니 확인해주세요!
추가적으로 컨벤션에 신경쓰면 좋을것 같아요 :)
- 인텔리제이의 자동 포맷 기능이 많은 부분들 교정해주기도 한답니다.
코드 자동 정렬하기 (Reformat Code)
MacOS: Cmd + Opt + l
Win/Linux: Ctrl + Alt + l
https://gmlwjd9405.github.io/2019/05/21/intellij-shortkey.html
| int game = 1; | ||
|
|
||
| while(game==1){ | ||
| int[] computer; |
| } | ||
| public static void main(String[] args) { | ||
| final int INITIAL_COUNT = 0; | ||
| final int Initial_Num = 0; |
Member
There was a problem hiding this comment.
상수는 보통 전체 대문자와 _로 띄어쓰기를 표현한답니다 :)
밑에 작성해주신 MAX_NUMBER_LENGTH 처럼요!
|
|
||
| while(numBoundary<3){ | ||
| if(numBoundary==0){ | ||
| _computerNum[numBoundary]=random.nextInt(8)+1; |
Member
There was a problem hiding this comment.
자바 컨벤션에 따르면 변수명에 언더바를 붙이지 않습니다 :)
| } | ||
| else{ | ||
| _computerNum[numBoundary]=random.nextInt(8)+1; | ||
| if(numBoundary==1 && _computerNum[numBoundary]==_computerNum[numBoundary-1]) continue; |
| return _computerNum; | ||
| } | ||
|
|
||
| public static int[] Check(int[] _userNum, int[] _computerNum){ |
Member
There was a problem hiding this comment.
메소드명은 소문자로 시작하고, 클래스명은 대문자로 시작합니다.
| for (int j = 0; j < 3; j++) { | ||
| for (int k = 0; k < 3; k++) { | ||
| if (_computerNum[j] == _userNum[k]) { | ||
| if (j == k) { |
Member
There was a problem hiding this comment.
indent가 4가 되는 부분이네요 😥
indent를 줄이는 가장 간단한 방법은 메소드 분리입니다!
| public static int[] Create(){ | ||
| Scanner input = new Scanner(System.in); | ||
| int[] _userNum = new int[3]; | ||
| int tmp = input.nextInt(); |
|
|
||
| public class Computer { | ||
|
|
||
| public static int[] Create(){ |
Member
There was a problem hiding this comment.
무엇을 만들어 내는지 표현할수 있지 않을까요?
Computer.create()는 마치 생성자와 같은 느낌이 들어 혼동이 올 수 있을것 같아요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.